home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20021006-20030409 / 000320_b.stewart@bom.gov.au_Mon Feb 17 19:39:35 EST 2003.msg < prev    next >
Text File  |  2020-01-01  |  6KB  |  140 lines

  1. Article: 14116 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!phl-feed.news.verio.net!iad-feed.news.verio.net!ord-feed.news.verio.net!stl-feed.news.verio.net!newsreader.wustl.edu!gumby.it.wmich.edu!out.nntp.be!propagator2-SanJose!in.nntp.be!newsfeed01.tsnz.net!ken-transit.news.telstra.net!news.telstra.net!vicpull1.telstra.net!not-for-mail
  3. Message-ID: <3E517F57.4394B12E@bom.gov.au>
  4. From: Bruce Stewart <b.stewart@bom.gov.au>
  5. X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
  6. X-Accept-Language: en
  7. MIME-Version: 1.0
  8. Newsgroups: comp.protocols.kermit.misc
  9. Subject: Re: Running multiple kermit scripts on one connection
  10. References: <775a2ab0.0302171458.f8f21f9@posting.google.com> <b2rrbl$ks3$1@watsol.cc.columbia.edu>
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. Lines: 118
  14. Date: Tue, 18 Feb 2003 11:33:27 +1100
  15. NNTP-Posting-Host: 134.178.5.131
  16. X-Complaints-To: abuse@telstra.net
  17. X-Trace: vicpull1.telstra.net 1045528188 134.178.5.131 (Tue, 18 Feb 2003 11:29:48 EST)
  18. NNTP-Posting-Date: Tue, 18 Feb 2003 11:29:48 EST
  19. Organization: Customer of Telstra Internet Direct
  20. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:14116
  21.  
  22. By the way, I'm using another account from now on. Its from a
  23. friend of mine named Bruce Stewart. So you will see Bruce Stewart
  24. in the Sender field, but it is really me, Minty.
  25.  
  26. Frank da Cruz wrote:
  27.  
  28. > In article <775a2ab0.0302171458.f8f21f9@posting.google.com>,
  29. > Minty <metceed@yahoo.com> wrote:
  30. > : I'm trying to run multiple kermit scripts over one dial-up connection.
  31. > : More specifically:
  32. > :
  33. > : I am writing a program that will automatically send an alert. One the
  34. > : the ways it sends an alert is via an sms message. I have an account
  35. > : with an pstn-to-sms gateway provider. So I can dial-up this gateway
  36. > : modem, and using the TAP protocol, I can send sms messages.
  37. > :
  38. > : What I want to do is control, within my program, the 2 main aspects of
  39. > : the sending process. The 'loggin on' part, and the 'sending messages
  40. > : part'. I already have a kermit script that does both. I want to
  41. > : seperate those to parts and call them seperately from my program. The
  42. > : reason is that there could be many messages going out for the one
  43. > : connection. This is decided at run-time. Another reason is so that the
  44. > : program can know which alerts got sent and which didn't.
  45. > :
  46. > : So, if for example I'm sending out 2 alerts, the steps would be as
  47. > : follows:
  48. > :
  49. > : 1-The program would run a kermit script, that opens connection from
  50. > : local pc to local modem, dials the gateway modem and logs on, as per
  51. > : the TAP protocol. The script would be called with the gateway provider
  52. > : number as parameter.
  53. > :
  54. > : 2-Then the program would run another kermit script, that sends
  55. > : messages as per TAP protocol, with the message and sms number as
  56. > : parameters, noting the exit code.
  57. > :
  58. > : 3-It would again call the same send script with another message and
  59. > : another number as parameter, again noting the exit code.
  60. > :
  61. > : 4-It calls another scipt, that logs off the connection to the gateway
  62. > : modem, and also closes connection from local pc to local modem.
  63. > :
  64. > : Now, the problem I have noted with running multiple kermit scripts, is
  65. > : that at the end of running one script, it closes the connection to the
  66. > : gateway modem and also the connection from the local pc to the local
  67. > : modem.
  68. > :
  69. > : I'm using the latest kermit 95 version on a Windows 2000 machine.
  70. > :
  71. > : Anyone have any ideas on how I could do this? I'm sure it's only a
  72. > : setting I would have to set with kermit, but I haven't found it.
  73. > :
  74. > : One idea I did try was to manually open an instance of kermit and open
  75. > : connection to local modem manually. Then call the other scripts to use
  76. > : this connection, but they wouldn't use it.
  77. > :
  78. > Ideally you'd like to be able to start Kermit and then send it messages
  79. > when you want it to do something.  Unfortunately, Kermit doesn't have a
  80. > way to wait for or send messages, so we have to devise a cunning plan.
  81. >
  82. > One idea would be to turn your application upside down and let Kermit
  83. > control the sequence of events.  For example, it could make the call, log
  84. > in, and then run your application with a command-line argument that says
  85. > "OK I'm logged in, now what?" and waits for your application to terminate.
  86. > At this point it can dispatch based on the return code, perhaps looking in
  87. > a prearranged file for instructions.  Repeat as needed.
  88. >
  89. > If that's not practical, there is a little-known way of making Kermit wait
  90. > for an event:
  91. >
  92. >   WAIT <interval-or-clock-time> FILE CREATION <filename>
  93. >
  94. > ("help wait" for details.)  This is admittedly a hack, and it would
  95. > require the same thing in the other direction, because at this point
  96. > Kermit is still running.
  97. >
  98. > Thus your application would have to spawn Kermit asynchronously, then
  99. > wait for a prearranged file to appear, which Kermit would create just
  100. > before doing the WAIT.  Then your application would do whatever it does,
  101. > and then when it's ready for Kermit to send a message, it would create
  102. > another prearranged file, the one that Kermit is WAITing for.  Obviously,
  103. > it would be handy if this file contained the message details.
  104. >
  105. > So the Kermit script would go about like this:
  106. >
  107. >   Make the call and log in.
  108. >   If this failed, return a failure code.
  109. >   If it succeeds, create the "I'm logged in" file.
  110. >   While true {
  111. >       Wait for message file.
  112. >       If message file says "Finished" {
  113. >           delete the "I'm logged in" file
  114. >           Hang up and exit.
  115. >       } else {
  116. >           send the message.
  117. >           delete (or rename) the message file
  118. >       }
  119. >   }
  120. >
  121. > Meanwhile your application would:
  122. >
  123. >   Spawn Kermit asynchronously
  124. >   Wait for the "I'm logged in" file
  125. >   While true {
  126. >       Make sure "I'm logged in" file still exists.
  127. >       Get a message to send.
  128. >       Create message file.
  129. >       Wait for message file to disappear.
  130. >   }
  131. >
  132. > Does this help?  It's not the fashiable TLA du jour but we've never been
  133. > particularly concerned with fashion :-)
  134. >
  135. > Obviously refinements are possible, such as queueing and various forms of
  136. > bulletproofing.
  137. >
  138. > - Frank
  139.  
  140.